({
    returnData: function (component) {

        // 调用条件
        const doCondition = component.get('v.doCondition');
        console.log('doCondition=', doCondition);

        if (doCondition == 'init') {
            console.log('fetch...Data');
            //获取值
            var searchKeyWord = component.get("v.searchKeyWord");
            var currentPage = component.get("v.currentPage");
            var pageSize = component.get("v.pageSize");
            // 
            var action = component.get("c.getEmployees");
            // 设置请求参数
            action.setParams({
                searchKeyWord: searchKeyWord,
                currentPage: currentPage,
                pageSize: pageSize
            });
            // 处理回调函数
            action.setCallback(this, function (res) {
                // 返回状态
                var state = res.getState();
                if (state == "SUCCESS") {
                    // 处理响应
                    var resMap = res.getReturnValue();
                    if (resMap.hasOwnProperty('record')) {
                        component.set("v.resData", resMap['record']);
                    }
                    if (resMap.hasOwnProperty('totalPage')) {
                        component.set("v.totalPage", resMap['totalPage']);
                    }
                } else {
                    // 处理错误
                    var errors = res.getError();
                    console.error(errors);
                }
            });
            // 队列处理
            $A.enqueueAction(action);
        }

        if (doCondition == 'doRegular') {
            console.log('init 转正申请');
            let action = component.get('c.doRegularApplication');
            action.setParams({
                ids: component.get('v.selectedRows')
            });
            action.setCallback(this, function(res) {
                if (res.getState() == 'SUCCESS') {
                    console.log('转正申请 callback..');
                } else {
                    // 处理错误
                    var errors = res.getError();
                    console.error(errors);
                    alert('该员工未能通过考核无法申请转正，请到该员工相关列表辞退该员工');
                }
            });
            $A.enqueueAction(action);
        }
    }
})